<%=render partial: "head",  as: "item"%> <!--引入头部的局部视图文件-->



<div class="container-fluid">
  <div class="row">
    <div class="col-lg-2 col-sm-3">
      <div class="list-group" id="left-list-group-id">
        <a class="list-group-item active" href="#">JAVA</a>
        <a class="list-group-item disabled" href="#">Ruby</a>
        <a class="list-group-item " href="#">Python3</a>
        <a class="list-group-item " href="#">JAVAScript</a>
        <a class="list-group-item disabled" href="#">IDEA</a>
      </div>
    </div>

    <div class="col-lg-10 col-sm-9">

      <div class="col-lg-10">
        <div style="background-color: khaki; height: auto">
          <p style="font-size: 22px; text-align: center; white-space: nowrap"><%= @post.title %></p>
          <style>
            /*副标题浮动*/
            .sub_heading_float li{
                float: left;
                margin-left: 40px;
            }
            .sub_heading_float{
                height: 30px;
            }
          </style>
          <ul id="sub_heading_ul" class="sub_heading_float">
            <li>作者：<%= @post.author %></li>
            <li>最后修改时间：2015-01-23 12:30:54</li>
          </ul>
          <div>
            <%= @post.context %>
          </div>


        </div>
      </div>

      <div class="col-lg-2">
        <p></p>
      </div>
    </div>

  </div>
</div>


<script type="text/javascript">
    var $tmp =  $("ul#nav-ui-id > li");
    var className = "active";
    $tmp.click(function() {
        $(this).addClass(className).siblings().removeClass(className);
    });

    /* 如果有disabled类，这禁用链接，否则为其修改样式并将其他的同类样式删除*/
    $("div#left-list-group-id > a").click(function() {
        if(false == $(this).hasClass("disabled")){
            $(this).addClass(className).siblings().removeClass(className);
        }else{
            $(this).removeAttr("href").removeAttr("onclick");
        }

    });
</script>


<%= link_to 'Edit', edit_post_path(@post) %> |
<%= link_to 'Back', posts_path %>
